import {h, init} from 'snabbdom'

let patch = init([])

let vnode = h('div#container', [
    h('h1', 'hello world'),
    h('p', 'this is p tag')
])

let app = document.querySelector('#app')

let oldNode = patch(app, vnode)

setTimeout(() => {
    vnode = h('div#container', [
        h('h1', 'hello world!!!'),
        h('p', 'hello p')
    ])

    patch(oldNode, vnode)

    setTimeout(() => {
        // patch(oldNode, null)
        patch(oldNode, h('!'))
    })

}, 2000)
